/*    * Timer类    * @author: kmlxk@yahoo.com.cn    * @created: 2011-2-12 18:51    * 
 * 方法:     *   
 * 构造函数: Timer(间隔, 回调函数)    
 * 清除: clear()    * 
 * 使用示例: var timer = new Timer(200, function(t) {alert('nana'); t.clear();} );        
*/    
function Timer(interval, functor) {        
	this.id = 'timer_'+Math.ceil(Math.random()*900000000+100000000);        
	eval(this.id+' = this;');        
	this.tid = setInterval(this.id+'.callback()',interval)        
	this.functor = functor;        
	this.callback = function(){            
		this.functor(this);        
	}        
	this.clear = function(){            
		clearInterval(this.tid);        
	}    
}